﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVKWZ"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    Loaded="Window_Loaded"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Background="White" 
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwKUNDADR" Source="{Binding Path=KUNDADR,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVPACK" Source="{Binding Path=VVPACK,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="600" />            
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2"  >
            <WrapPanel Name="ZoneOrder">
                <TextBlock FontSize="18"  Height="Auto" Width="Auto"  Text="{Binding Source={Localization:Translate Word=订单号/品种:}}" ></TextBlock>
                <TextBox   FontSize="18" Name="txtVKPAUFKRS"  Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBox  FontSize="18" Name="txtVKPAUFLFD"  Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBox  FontSize="18" Name="txtVKPAUFPOS"  Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBlock  FontSize="18" VerticalAlignment="Center"  Text="{Binding Source={Localization:Translate Word=按品种}}" ></TextBlock>
                <CheckBox Name="ChkCP" VerticalAlignment="Center"  IsChecked="True"
                          Background="White"
                          >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=语言}}" ></TextBlock>
                <TextBox Name="txtLang">CN</TextBox>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=库区}}" Width="40" ></TextBlock>
                <TextBox Name="txtLB">CP</TextBox>
                <TextBlock  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=布卷清单}}" ></TextBlock>
                <Button   Height="30"   Name="btnPreview" Width="30" Click="btnPrintWB_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/excel_icon.jpg" />
                    </Button.Background>
                </Button>
                <TextBlock Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=留位清单}}" ></TextBlock>
                <Button   Height="30" Name="btnPrint" Width="30" Click="btnPrint_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Print.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </StackPanel> 
        <StackPanel   Grid.Row="1">
            <DataGrid 
                            CanUserReorderColumns="True"  
                            CanUserResizeRows="True" CanUserSortColumns="True"
                            AutoGenerateColumns="False"   
                            EnableRowVirtualization="True"  
                            RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                            ItemsSource="{Binding Source={StaticResource ResourceKey=vwVVTLIEF}}" 
                            Margin="0,2,0,0" 
                            x:Name="dlgVKPOS" >
                            <DataGrid.Columns>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=发货单}}"  Binding="{Binding VVTLIEFSCH,Converter={StaticResource ResourceKey=pnum}}" Width="80"/>
                                <DataGridTextColumn    Binding="{Binding VVTAUFKRS}" Width="40"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=销售单}}" Binding="{Binding VVTAUFLFD}" Width="80"/>
                    <DataGridTextColumn  Binding="{Binding VVTAUFPOS}" Width="40"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=批次}}" Binding="{Binding VVTTEILNR,Converter={StaticResource ResourceKey=pnum}}" Width="80"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=留位}}" Binding="{Binding VVTMTR,Converter={StaticResource ResourceKey=d100}}" Width="120"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=单位}}" Binding="{Binding VVTME}"/>
                            </DataGrid.Columns>
                        </DataGrid  >
            <WrapPanel>
                <Button Click="cmdUpdateWBBPACKNR_Click"  Content="{Binding Source={Localization:Translate Word=更新小卷号}}" ></Button>
                <TextBox Background="White" BorderBrush="AliceBlue" Width="60" Text="{Binding WBBPACKNR,Source={StaticResource ResourceKey=vwWBBST}}" KeyDown="TextBox_KeyDown"></TextBox>
            </WrapPanel>
            <DataGrid  
                AutoGenerateColumns="False" 
                MaxHeight="300"
                HorizontalScrollBarVisibility="Auto"
                VerticalScrollBarVisibility="Auto"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWBBST}}" 
                Margin="0,0,0,0" 
                x:Name="listWBBST" Height="Auto">
                <DataGrid.Columns>
                    
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=序号}}" Binding="{Binding CODE}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=小卷号}}" Binding="{Binding WBBPACKNR, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=原卷号}}" Binding="{Binding WBBDPART2}" Width="60"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(码)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=缸号}}" Binding="{Binding WBBDPART}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=色级}}" Binding="{Binding WBBTAX}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=板号}}" Binding="{Binding WBBRWLFD}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=布卷号}}" Binding="{Binding WBBSTKNR}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=品种}}"  Binding="{Binding WBBART}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=颜色}}" Binding="{Binding WBBFARBE}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=后整理方式}}" Binding="{Binding WBBBESCHICH}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=重量(KG)}}" Binding="{Binding WBBSGEW}"/>
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>       
    </Grid>
</local:DocumentBase>